home *** CD-ROM | disk | FTP | other *** search
/ The Essential Home & Business Collection / The Essential Home & Business Collection.iso / 27 / 3 / 5 / HP22D5.ZIP / EXTERN / BORDER.ASM < prev    next >
Assembly Source File  |  1991-04-16  |  1KB  |  63 lines

  1. ;
  2. ; SetBorder: Extension that sets the border color to a particular value.
  3. ;
  4. ; To use this extension from HyperPAD, move the extension into the desired
  5. ; pad (or into the home pad if you need from more than one pad).
  6. ;
  7. ; Examples:
  8. ;
  9. ;        SetBorder blue;
  10. ;        SetBorder red;
  11. ;        for i = 1 to 16 do SetBorder i;
  12. ;
  13. ;
  14. ; This routine will work on EGA, VGA, and CGA. It will have no effect on MONO.
  15. ;
  16. DOSSEG
  17. .MODEL        LARGE
  18.  
  19. EXTRN htoi:FAR
  20.  
  21. include        extern.inc
  22.  
  23. .DATA
  24.  
  25. SetBorderName      db        'setBorder',0
  26.  
  27. Pool        PoolStruct    <SetBorderName,SetBorder,,HANDLER>
  28.         PoolStruct    <>    ;END
  29.  
  30. .CODE
  31.  
  32. SetBorder    proc        far
  33.         push        bp
  34.         mov        bp,sp
  35.         push        di
  36.  
  37.         mov        ax,[bp+6]    ;NumArgs
  38.         cmp        ax,1
  39.         jne        SB_END
  40.  
  41.         ;get the handle to argument, convert it to an integer
  42.         les        di,[bp+8]    ;ES:DI = hArg1
  43.         push        es
  44.         push        di
  45.         call        htoi        ;AX = integer value
  46.  
  47.         ;set the border color using the video BIOS
  48.         mov        bl,al        ;bl = BorderValue
  49.         xor        bh,bh        ;bh = subfunction number
  50.         mov        ah,0bh        ;ah = int 10h function number
  51.         int        10h        ;set the border value
  52.  
  53. SB_END:
  54.         mov        ax,STOP        ;terminate this message
  55.         pop        di
  56.         pop        bp
  57.         retf
  58. SetBorder    endp
  59.  
  60. END
  61.  
  62.  
  63.